<template>
  <div class="swipe-item" :style="style">
    <slot />
  </div>
</template>
<script>
export default {
  data() {
    return {
      width: 0,
      offset: 0
    }
  },
  beforeCreate() {
    this.$parent.swipes.push(this)
  },
  computed: {
    style() {
      return {
        width: `${this.width}px`,
        transform: `translate3d(${this.offset}px, 0, 0)`
      }
    }
  }
}
</script>
<style lang="less" scoped>
.swipe-item{
  float: left;
}
</style>